/*
    www.cguage.com
    2.1 a^3 + b^3 + c^3 = abc 求出所有满足条件的三位正整数
*/

#include <iostream>
#include <sstream>
#include <cassert>
#include <vector>
using namespace std;

#ifndef TEST
#define IN(iss) {                       \
        std::string str;                \
        std::getline(std::cin, str);    \
        iss.str(str);                   \
    }
#define OUT(s) std::cout << s
#endif

#define READ_N(iss, n) {    \
    iss >> n;               \
    iss.ignore(1, ',');     \
}

int main() {
    int a = 0, b = 0, c = 0;
    ostringstream oss;
    for (int i = 100; i <= 999; ++i) {
        a = i / 100;
        b = (i % 100) / 10;
        c = i % 10;
        if (a * a * a + b * b * b + c * c * c == i) {
            oss << i << ",";
        }
    }
    string str = oss.str();
    str.erase(str.end() - 1);
    OUT(str);
    return 0;
}

#ifdef TEST
struct TestCase CASES[] = {
    /*0*/{"", "153,370,371,407"},
};
#endif